package com.ssx.es.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Package com.ssx.es.config
 * @ClassName ESconfig
 * @Copyright: Copyright (c) 2020
 * @Date 2020/12/5 9:07
 * @Company www.sudaoxi.com.cn
 * @Author 苏道羲
 * @Version 1.0
 * @Description
 */
@Configuration
public class ESconfig {
    @Bean
    public RestHighLevelClient restHighLevelClient(){
        RestHighLevelClient client=new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost",9200,"http")));
        return client;
    }
}
